import { IParam } from '../../common';
import { IFormDetailAbility } from '../ability/i-form-detail-ability';

/**
 * 表单成员控制器基类接口
 *
 * @export
 * @interface IFormDetailController
 */
export interface IFormDetailController<
	A extends IFormDetailAbility = IFormDetailAbility
> {
    /**
     * 控制器名称
     *
     * @type {string}
     * @memberof IFormDetailController
     */
    name: string;
    
    /**
     * 控制器标识
     *
     * @type {string}
     * @memberof IFormDetailController
     */
    codeName: string;

    /**
     * 成员类型
     *
     * @type {string}
     * @memberof IFormDetailController
     */
    detailType: string;

    /**
     * 成员是否显示
     *
     * @type {boolean}
     * @memberof IFormDetailController
     */
    visible: boolean;

    /**
     * 是否必填
     *
     * @type {boolean}
     * @memberof IFormDetailController
     */
    required: boolean;

    /**
     * 是否禁用
     *
     * @type {boolean}
     * @memberof IFormDetailController
     */
    disabled: boolean;

    /**
     * 错误提示
     *
     * @type {string}
     * @memberof IFormDetailController
     */
    errorMessage:string;

    /**
     * 值规则
     *
     * @type {IParam[]}
     * @memberof IFormDetailController
     */
    valueRules: IParam[];
    
    /**
     * 父是否为重复器
     *
     * @type {boolean}
     * @memberof IFormDetailController
     */
    parentIsRepeater: boolean;

    /**
     * 父重复器标识名称
     *
     * @type {string}
     * @memberof IFormDetailController
     */
    parentCodeName: string;

    /**
     * 重复器子成员
     *
     * @type {IParam[]}
     * @memberof IFormDetailController
     */
    childrenDetailModel: IParam[];

    /**
     * 重复器子成员标识
     *
     * @type {string[]}
     * @memberof IFormDetailController
     */
    childrenCodeName: string[];

    /**
     * 获取模型数据
     *
     * @return {*}  {IParam}
     * @memberof IFormDetailController
     */
    getModel(): IParam;

	/**
	 * 获取能力
	 *
	 * @return {*}  {A}
	 * @memberof IFormDetailController
	 */
	getAbility(): A;

	/**
	 * 设置能力
	 *
	 * @param {A} ability
	 * @memberof IFormDetailController
	 */
	setAbility(ability: A): void;
}
